home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Snippets / PNL Libraries / Libraries / ODB Engine / ODBEngine.h < prev    next >
Text File  |  1996-10-10  |  3KB  |  221 lines

  1.  
  2. /*© copyright 1996 UserLand Software, Inc. All Rights Reserved.*/
  3.  
  4.  
  5. #ifndef odbEngineInclude
  6. #define odbEngineInclude
  7.  
  8. #include <Types.h>
  9. #include <QuickDraw.h>
  10. #include <Files.h>
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16.  
  17. typedef struct odb_ * odbRef;
  18.  
  19. typedef unsigned short odbBool;
  20.  
  21. typedef unsigned char odbString [256];
  22.  
  23. typedef enum odbDirection {
  24.     
  25.     nodirection = 0, 
  26.     
  27.     dir_up = 1, 
  28.     
  29.     dir_down = 2, 
  30.     
  31.     dir_left = 3,
  32.     
  33.     dir_right = 4, 
  34.     
  35.     dir_flatup = 5, 
  36.     
  37.     dir_flatdown = 6, 
  38.     
  39.     dir_sorted = 8,
  40.     
  41.     dir_pageup = 9,
  42.     
  43.     dir_pagedown = 10,
  44.     
  45.     dir_pageleft = 11,
  46.     
  47.     dir_pageright = 12
  48.     } odbDirection;
  49.  
  50.  
  51. typedef enum odbValueType  {
  52.     
  53.     unknownvaluetype = '????',
  54.     
  55.     charvaluetype = 'char',
  56.     
  57.     shortvaluetype = 'shor',
  58.     
  59.     longvaluetype = 'long',
  60.     
  61.     binaryvaluetype = 'data',
  62.     
  63.     booleanvaluetype = 'bool',
  64.     
  65.     tokenvaluetype = 'tokn',
  66.     
  67.     datevaluetype = 'date',
  68.     
  69.     addressvaluetype = 'addr',
  70.     
  71.     codevaluetype = 'code',
  72.     
  73.     extendedvaluetype = 'exte',
  74.     
  75.     stringvaluetype = 'TEXT',
  76.     
  77.     externalvaluetype = 'xtrn',
  78.     
  79.     directionvaluetype = 'dir ',
  80.     
  81.     string4valuetype = 'type',
  82.     
  83.     pointvaluetype = 'QDpt',
  84.     
  85.     rectvaluetype = 'qdrt',
  86.     
  87.     patternvaluetype = 'tptn',
  88.     
  89.     rgbvaluetype = 'cRGB',
  90.     
  91.     fixedvaluetype = 'fixd',
  92.     
  93.     singlevaluetype = 'sing',
  94.     
  95.     doublevaluetype = 'doub',
  96.     
  97.     objspecvaluetype = 'obj ',
  98.     
  99.     filespecvaluetype = 'fss ',
  100.     
  101.     aliasvaluetype = 'alis',
  102.     
  103.     enumeratorvaluetype = 'enum',
  104.     
  105.     listvaluetype = 'list',
  106.     
  107.     recordvaluetype = 'reco',
  108.     
  109.     outlinevaluetype = 'optx',
  110.     
  111.     wptextvaluetype = 'wptx',
  112.     
  113.     tablevaluetype = 'tabl',
  114.     
  115.     scriptvaluetype = 'scpt',
  116.     
  117.     menubarvaluetype = 'mbar',
  118.     
  119.     picturevaluetype = 'pict'
  120.     
  121.     } odbValueType;
  122.  
  123.  
  124. typedef union odbValueData {
  125.     
  126.     odbBool flvalue;
  127.     
  128.     unsigned char chvalue;
  129.     
  130.     short intvalue;
  131.     
  132.     long longvalue;
  133.     
  134.     unsigned long datevalue;
  135.     
  136.     odbDirection dirvalue;
  137.     
  138.     OSType ostypevalue;
  139.     
  140.     Handle stringvalue;
  141.     
  142.     Handle addressvalue;
  143.     
  144.     Handle binaryvalue;
  145.     
  146.     Handle externalvalue;
  147.     
  148.     Point pointvalue;
  149.     
  150.     Rect **rectvalue;
  151.     
  152.     Pattern **patternvalue;
  153.     
  154.     RGBColor **rgbvalue;
  155.     
  156.     Fixed fixedvalue;
  157.     
  158.     float singlevalue;
  159.     
  160.     double **doublevalue;
  161.     
  162.     Handle objspecvalue;
  163.     
  164.     FSSpec **filespecvalue;
  165.     
  166.     Handle aliasvalue; /*AliasHandle*/
  167.     
  168.     OSType enumvalue;
  169.     
  170.     Handle listvalue;
  171.     
  172.     Handle recordvalue;
  173.     } odbValueData;
  174.  
  175.  
  176. typedef struct odbValueRecord {
  177.     
  178.     odbValueType valuetype;
  179.     
  180.     odbValueData data;
  181.     } odbValueRecord;
  182.  
  183.  
  184. /*prototypes*/
  185.  
  186. extern pascal odbBool odbNewFile (short);
  187.  
  188. extern pascal odbBool odbOpenFile (short, odbRef *odb);
  189.  
  190. extern pascal odbBool odbSaveFile (odbRef odb);
  191.  
  192. extern pascal odbBool odbCloseFile (odbRef odb);
  193.  
  194. extern pascal odbBool odbDefined (odbRef odb, odbString bspath);
  195.  
  196. extern pascal odbBool odbDelete (odbRef odb, odbString bspath);
  197.  
  198. extern pascal odbBool odbGetType (odbRef odb, odbString bspath, OSType *type);
  199.  
  200. extern pascal odbBool odbGetValue (odbRef odb, odbString bspath, odbValueRecord *value);
  201.  
  202. extern pascal odbBool odbSetValue (odbRef odb, odbString bspath, odbValueRecord *value);
  203.  
  204. extern pascal odbBool odbNewTable (odbRef odb, odbString bspath);
  205.  
  206. extern pascal odbBool odbCountItems (odbRef odb, odbString bspath, long *count);
  207.  
  208. extern pascal odbBool odbGetNthItem (odbRef odb, odbString bspath, long n, odbString bsname);
  209.  
  210. extern pascal odbBool odbGetModDate (odbRef odb, odbString bspath, unsigned long *date);
  211.  
  212. extern pascal void odbDisposeValue (odbRef odb, odbValueRecord *value);
  213.  
  214. extern pascal void odbGetError (odbString bs);
  215.  
  216. #ifdef __cplusplus
  217. }
  218. #endif
  219.  
  220. #endif
  221.